<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\UserSymptom
 *
 * @property int $id
 * @property string $title 标题
 * @property string $keyword
 * @property int $posture_id 视图id
 * @property int $part_id 部位id
 * @property int $order 排序
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property-read \App\Models\UserPart|null $part
 * @property-read \App\Models\UserPosture|null $posture
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom query()
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom whereKeyword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom whereOrder($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom wherePartId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom wherePostureId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom withTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|UserSymptom withoutTrashed()
 * @mixin \Eloquent
 */
class UserSymptom extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'user_symptom';

    public function posture(): BelongsTo
    {
        return $this->belongsTo(UserPosture::class, 'posture_id');
    }

    public function part(): BelongsTo
    {
        return $this->belongsTo(UserPart::class, 'part_id');
    }

}
